<div ng-controller="ActivityCtrl">
<ul class="nav nav-tabs activity_tab">
    <li class="{{ all_active }}"><a ng-click="all()">任务</a></li>
    <li class="{{ run_active }}"><a ng-click="running()">执行中</a></li>
    <li class="{{ failed_active }}"><a ng-click="failed()">失败</a></li>
</ul>
<div class="tab-content">
    <div class="tab-pane active" ng-show="activity_show=='all'">
        <table class="table table-striped table-bordered table-condensed" >
            <thead>
            <tr>
                <th>任务id</th>
                <th>名称</th>
                <th>任务对象</th>
                <th>对象类型</th>
                <th>开始时间</th>
                <th>结束时间</th>
                <th>结果</th>
                <th>状态</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="activity in activities">
                <td>{{ activity.meta.task_id }}</td>
                <td>{{ activity.name }}</td>
                <td>{{ activity.target }}</td>
                <td>{{ activity.type }}</td>
                <td>{{ activity.time|date:'yyyy-MM-dd HH:mm:ss Z' }}</td>
                <td>{{ activity.meta.date_done|date:'yyyy-MM-dd HH:mm:ss Z' }}<img ng-hide="activity.meta.date_done"
                                                                                   src="/static/images/activity_load.gif"
                                                                                   alt="执行中"/></td>
                <td>{{ activity.result }}</td>
                <td>
                    <span ng-show="activity.meta.status=='SUCCESS'"> <img src="/static/images/success.png"
                                                                          alt="success"/></span>
                    <span ng-show="activity.meta.status=='FAILURE'"> <img src="/static/images/failure.png" alt="failure"
                                                                          class="img-size16"/></span>
                    <img ng-hide="activity.meta.status=='FAILURE'||activity.meta.status=='SUCCESS'"
                         src="/static/images/activity_load.gif" alt="执行中"/>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <div class="tab-pane active"  ng-show="activity_show=='running'">
        <table class="table table-striped table-bordered table-condensed" >
            <thead>
            <tr>
                <th>任务id</th>
                <th>名称</th>
                <th>任务对象</th>
                <th>对象类型</th>
                <th>开始时间</th>
                <th>结束时间</th>
                <th>结果</th>
                <th>状态</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="activity in activities|activity_running">
                <td>{{ activity.meta.task_id }}</td>
                <td>{{ activity.name }}</td>
                <td>{{ activity.target }}</td>
                <td>{{ activity.type }}</td>
                <td>{{ activity.time|date:'yyyy-MM-dd HH:mm:ss Z' }}</td>
                <td>{{ activity.meta.date_done|date:'yyyy-MM-dd HH:mm:ss Z' }}<img ng-hide="activity.meta.date_done"
                                                                                   src="/static/images/activity_load.gif"
                                                                                   alt="执行中"/></td>
                <td>{{ activity.result }}</td>
                <td>
                    <img src="/static/images/activity_load.gif" alt="执行中"/>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
    <div class="tab-pane active"  ng-show="activity_show=='failed'">
        <table class="table table-striped table-bordered table-condensed" >
            <thead>
            <tr>
                <th>任务id</th>
                <th>名称</th>
                <th>任务对象</th>
                <th>对象类型</th>
                <th>开始时间</th>
                <th>结束时间</th>
                <th>结果</th>
                <th>状态</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="activity in activities | activity_failed">
                <td>{{ activity.meta.task_id }}</td>
                <td>{{ activity.name }}</td>
                <td>{{ activity.target }}</td>
                <td>{{ activity.type }}</td>
                <td>{{ activity.time|date:'yyyy-MM-dd HH:mm:ss Z' }}</td>
                <td>{{ activity.meta.date_done|date:'yyyy-MM-dd HH:mm:ss Z' }}<img ng-hide="activity.meta.date_done"
                                                                                   src="/static/images/activity_load.gif"
                                                                                   alt="执行中"/></td>
                <td>{{ activity.result }}</td>
                <td>

                    <span ng-show="activity.meta.status=='FAILURE'"> <img src="/static/images/failure.png" alt="failure"
                                                                          class="img-size16"/></span>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>


</div>